package com.cadre.system.service.impl;

import com.cadre.system.domain.officer.A79;
import com.cadre.system.domain.officer.FamilyInfo;
import com.cadre.system.mapper.A79Mapper;
import com.cadre.system.service.FamilyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service("familyService")
public class FamilyServiceImpl implements FamilyService {
    @Autowired
    private A79Mapper a79Mapper;

    @Override
    public List<FamilyInfo> familyinfo(String personid) {
        List<FamilyInfo> familyInfos = new ArrayList<>();
        List<A79> a79s = this.a79Mapper.selectByPersonid(personid);
        if (a79s.size() != 0) {
            for (int i = 0; i < a79s.size(); i++) {
                FamilyInfo familyInfo = new FamilyInfo();
                familyInfo.setFlowid(a79s.get(i).getFlowid());
                familyInfo.setPersonid(a79s.get(i).getPersonid());
                familyInfo.setA7910(a79s.get(i).getA7910());
                familyInfo.setA7912(a79s.get(i).getA7912());
                familyInfo.setA7913(a79s.get(i).getA7913());
                familyInfo.setA7921(a79s.get(i).getA7921());
                familyInfo.setA7923(a79s.get(i).getA7923());
                familyInfo.setA7924(a79s.get(i).getA7924());
                familyInfo.setA7926(a79s.get(i).getA7926());
                familyInfos.add(familyInfo);
            }
        } else {
            System.out.println("-------------familyInfo  null------------");
        }
        return familyInfos;
    }
}
